package com.wealth.lottery.entity;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.wealth.system.entity.Corporation;
/**
 * 抽奖活动实体类
 * @author lihang  2016-06-27
 */
@Entity
@Table(name="lottery_activity")
public class LotteryActivity implements Serializable{
	private static final long serialVersionUID = 1L;
	private Long id; //主键id
	private String name; //活动名称
	private String  remark; //备注
	private String  picurl; //图片途径
	private Date startTime;  //活动开始时间start_time
	private  Date endTime;   //活动结束时间 end_time
	private int type;  //活动类型  1转盘 2摇一摇
	private int daytimes; //活动每天/每人抽奖最大次数 -1表示不限制(扩展1:活动/粉丝/参与N次，扩展2:活动/N积分可以参与)
	private int status; //活动状态 0删除 1启动 2停用 默认为1
	private double score;  //多少积分能在此活动下抽一次奖
	private Date createTime; //创建时间create_time
	private String creator;  //创建人
	private Corporation corp; //corp_id
	private int scoretype;  
	private List<LotteryPrize> prizeList = new ArrayList<LotteryPrize>();
	public LotteryActivity() {
		super();
	}
	public LotteryActivity(Long id) {
		super();
		this.id = id;
	}
	/*----------------------------get and set------------------------------------*/
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getRemark() {
		return remark;
	}
	public void setRemark(String remark) {
		this.remark = remark;
	}
	public String getPicurl() {
		return picurl;
	}
	public void setPicurl(String picurl) {
		this.picurl = picurl;
	}
	@Column(name="start_time")
	public Date getStartTime() {
		return startTime;
	}
	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	@Column(name="end_time")
	public Date getEndTime() {
		return endTime;
	}
	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	public int getType() {
		return type;
	}
	public void setType(int type) {
		this.type = type;
	}
	public int getDaytimes() {
		return daytimes;
	}
	public void setDaytimes(int daytimes) {
		this.daytimes = daytimes;
	}
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	@Column(name="create_time")
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public String getCreator() {
		return creator;
	}
	public void setCreator(String creator) {
		this.creator = creator;
	}
	@ManyToOne
	@JoinColumn(name="corp_id")
	public Corporation getCorp() {
		return corp;
	}
	public void setCorp(Corporation corp) {
		this.corp = corp;
	}
	@OneToMany(mappedBy="lotteryactivity")
	@JsonIgnore
	public List<LotteryPrize> getPrizeList() {
		return prizeList;
	}
	public void setPrizeList(List<LotteryPrize> prizeList) {
		this.prizeList = prizeList;
	}
	public double getScore() {
		return score;
	}
	public void setScore(double score) {
		this.score = score;
	}
	public int getScoretype() {
		return scoretype;
	}
	public void setScoretype(int scoretype) {
		this.scoretype = scoretype;
	}
	

}
